import UIKit

actor TemperatureLogger {
    let label: String
    var measurements: [Int]
    private(set) var max: Int

    init(label: String, measurement: Int) {
        self.label = label
        measurements = [measurement]
        self.max = measurement
    }
}



extension TemperatureLogger {
  func update(with measurement: Int) {
    measurements.append(measurement)
    if measurement > max {
      max = measurement
    }
  }
 }
extension TemperatureLogger {
  func convertFahrenheitToCelsius() {
    measurements = measurements.map { measurement in
      (measurement - 32) * 5 / 9
    }
  }
}

func testActor() async{
  let logger = TemperatureLogger(label: "Outdoors", measurement: 25)
  print(await logger.max)
  // Prints "25"
}
Task {
  await testActor()
}
print("hello")
